<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
  <title>Haru Free PDF Library</title>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <link href="default.css" type="text/css" rel="stylesheet">
</head>
<body>
<div id="headcontainer">
<div class="head"><img alt="Haru Free PDF Library"
 src="image/harulogo.png" style="width: 413px; height: 40px;"></div>
</div>
<div id="barcontainer">
<div class="buildbar"><a href="index.html">home</a> | <a
 href="http://sourceforge.net/project/showfiles.php?group_id=83044">download</a>
|
<a href="documentation.html">documentation </a>| <a
 href="examples.html">examples </a>| <a
 href="http://sourceforge.net/projects/libharu/">sourceforge</a> |
<a href="http://sourceforge.net/forum/?group_id=83044">forums</a><br>
</div>
</div>
<div id="container">
<div id="mainpage">
<div id="ccol">
<h2>Compile Your Program<br>
</h2>
<h3><a name="GCC_"></a>GCC<br>
</h3>
<div class="bodytext1"><span style="font-weight: bold;">1. Static
library</span><br>
<div class="bodytext5">If you installed Haru as a static library, a
typical command for compiling on gcc is as follows.<br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c -lhpdf
-lpng -lz -lm<br>
</div>
<br>
"-lm" option is not required according to the version of gcc. <br>
"-lpng" option is not required&nbsp; when a program does not use a png
image.<br>
"-mno-cygwin" option is required to use MinGW on cygwin.<br>
<br>
If include files and libhpdf.a are in a directory that the compiler and
linker cannot find out,&nbsp; add -I and -L options.<br>
For example,<br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c <span
 style="color: rgb(204, 0, 0);">-L../../
-I../include</span> -lhpdf
-lpng -lz -lm<br>
</div>
<br>
If you want to use MinGW on cygwin, "-mno-cygwin" option is required.
In this case, you have to prepare zlib.a and libpng.a for MinGW.<br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c <span
 style="color: rgb(204, 0, 0);">-mno-cygwin</span> -lhpdf
-lpng -lz -lm<br>
</div>
<br>
</div>
</div>
<div class="bodytext1"><span style="font-weight: bold;">2. Shared
library</span><br>
<div class="bodytext5">If you installed Haru as a shared library, you
have to add "-DHPDF_SHARED" option to compiling command. <br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c <span
 style="color: rgb(204, 0, 0);">-DHPDF_SHARED</span> -lhpdf
-lpng -lz -lm<br>
</div>
<br>
If include files and libhpdf.a are in a directory that the compiler and
linker cannot find out,&nbsp; add -I and -L options.<br>
For example,<br>
If you use MinGW,&nbsp; use "-DHPDF_DLL" instead of "-DHPDF_SHARED".<br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c <span
 style="color: rgb(204, 0, 0);">-L../../
-I../include</span> -DHPDF_SHARED -lhpdf
-lpng -lz -lm<br>
</div>
</div>
</div>
<br>
<div class="bodytext1"><span style="font-weight: bold;">3. Compiling
programs in C++</span><br>
<div class="bodytext5">The compiling command for a C++ is almost the
same as C except for adding "-lstdc++".&nbsp;<br>
<br>
<div class="bodycode">gcc -o myprogram -O2 -Wall myprogram.c -lhpdf
-lpng -lz -lm -lstdc++
</div>
</div>
</div>
<br>
<h3><a name="Microsoft_VC_"></a>Microsoft VC++ <br>
</h3>
<div class="bodytext1"><span style="font-weight: bold;">1. Static
library</span><br>
<div class="bodytext5">If you installed Haru as a static library, a
typical command for compiling on VC++ is as follows.<br>
<br>
<div class="bodycode">cl -Femyprogram.exe <span
 style="color: rgb(204, 0, 0);">-MT</span> -O2 <span
 style="color: rgb(204, 0, 0);">-Iinclude</span> <span
 style="color: rgb(204, 0, 0);">-Iwin32\include</span>
myprogram.c /link <span style="color: rgb(204, 0, 0);">/LIBPATH:.
/LIBPATH:win32\msvc</span> libhpdf.lib libpng.lib zlib.lib<br>
</div>
<br>
The following options must be changed depending on your environment.<br>
<br>
[-MT]<br>
In the default setting, Haru is configured to link with LIBCMT.LIB.<br>
<br>
<div class="bodynote">NOTE:
<br>
libpng.lib and zlib.lib provided in win32\msvc directory are configured
using LIBCMT.LIB. If you want to use MSVCRTXX, you should builed
libpng.lib and zlib.lib yourself with -MD option.<br>
</div>
<br>
[-I] <br>
Because of "hpdf_*.h" and header files for zlib/pnglib are required to
compile a program, add "include" and "win32\include" directory to the
list of directories to be searched for header files. <br>
<br>
[/LIBPATH]<br>
To link libhpdf.lib, zlib.lib, libpng.lib, it needs to add directories
of these files to the list of directories to be searched for library
files.<br>
The library files of zlib, pnglib for Microsoft C++ are prepared in
win32/msvc directory.<br>
<br>
<div class="bodynote">NOTE:
<br>
If you prepare libpng.lib and zlib.lib yourself (dont use the files in
win32\msvc directory), change&nbsp; /LIBPATH options to appropriate
directory name.<br>
</div>
<br>
</div>
</div>
<div class="bodytext1"><span style="font-weight: bold;">2. Shared
library</span><br>
<div class="bodytext5">If you installed Haru as a shared library(.DLL),
a
typical command for compiling is as follows.<br>
<br>
<div class="bodycode">cl -Femyprogram.exe <span
 style="color: rgb(204, 0, 0);">-MT</span> -O2 <span
 style="color: rgb(204, 0, 0);">-Iinclude</span> <span
 style="color: rgb(204, 0, 0);">-DHPDF_DLL</span> myprogram.c /link <span
 style="color: rgb(204, 0, 0);">/LIBPATH:.</span> libhpdf_dll.lib
</div>
<br>
-DHPDF_DLL directive must be add to compile a program which uses
libhpdf.dll.<br>
</div>
</div>
<br>
<h3><a name="Borland_C_"></a>Borland C++ <br>
</h3>
<div class="bodytext1"><span style="font-weight: bold;">1. Static
library</span><br>
<div class="bodytext5">If you installed Haru as a static library, a
typical command for compiling on Borland C++ is as follows.<br>
<br>
<div class="bodycode">bcc32 -emyprogram.exe <span
 style="color: rgb(204, 0, 0);">-WM</span> -O2 <span
 style="color: rgb(204, 0, 0);">-Iinclude</span> <span
 style="color: rgb(204, 0, 0);">-Iwin32\include</span> <span
 style="color: rgb(204, 0, 0);">-L. -Lwin32\bcc32</span> libhpdf.lib
libpng.lib zlib.lib myprogram.c
</div>
<br>
The following options must be changed depending on your environment.<br>
<br>
[-WM]<br>
In the default setting, Haru is configured to link with multi-thread
library.<br>
<br>
[-I] <br>
Because of "hpdf_*.h" and header files for zlib/pnglib are required to
compile a program, add "include" and "win32\include" directory to the
list of directories to be searched for header files. <br>
<br>
[-L]<br>
To link libhpdf.lib, zlib.lib, libpng.lib, it needs to add directories
of these files to the list of directories to be searched for library
files.<br>
The library files of zlib, pnglib for borland c++ are prepared in
win32/bcc32 directory.<br>
</div>
</div>
<br>
<div class="bodytext1"><span style="font-weight: bold;">2. Shared
library</span><br>
<div class="bodytext5">If you installed Haru as a shared library(.DLL),
a
typical command for compiling is as follows.<br>
<br>
<div class="bodycode">bcc32 -emyprogram.exe <span
 style="color: rgb(204, 0, 0);">-WM</span> -O2 <span
 style="color: rgb(204, 0, 0);">-Iinclude</span> <span
 style="color: rgb(204, 0, 0);">-DHPDF_DLL</span> <span
 style="color: rgb(204, 0, 0);">-L. -Lwin32\bcc32</span> libhpdf.lib
myprogram.c
</div>
<br>
-DHPDF_DLL directive must be add to compile a program which uses
libhpdf.dll.<br>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<br>
<br>
</div>
<div id="lcol">
<div class="sidebar"><br>
<ul>
  <li><a href="#GCC_">GCC</a><br>
  </li>
  <li><a href="#Microsoft_VC_"> Microsoft VC++</a><br>
  </li>
  <li><a href="#Borland_C_">BorlandC++</a></li>
  <span style="font-weight: bold;"></span>
</ul>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<small><small><small>LAST UPDATE 2006.09.06</small></small></small><br>
</div>
</div>
<br>
<br>
</div>
</body>
</html>
